@extends('layout.home')

@section('css')
<link rel="stylesheet" type="text/css" href="/homes/css/det.css">
@endsection

@section('content')
@if($type=='scre')


    <div class="work-perform-box col-md-12"  >
          


          <div id='detail' style="">
            <div class="card-container-2">
        <h1 >&nbsp;&nbsp;&nbsp;标题：{{$det[0]->name}} </h1>

                <div class="controller right"></div>
                <div class="controller left"></div>
                <div class="card-holder">
                <div class="card" > 
                    <img class="img-responsive"  src="{{$det['0']->path}}" alt="">
                 </div>
                @foreach($det as $k=>$v)
                @if($k != 0)
                  <div class="card" style="display:none"> 
                    <img class="img-responsive" src="{{$v->path}}" alt="">
                  </div>
                 @endif
                 @endforeach
                </div>
              </div>

          </div>
          
        </div>
        

        <script type="text/javascript">
            var cc2 = $('.card-container-2');
            cc2.children('.right').on('click',function(){
              var firstCard = $('.card-container-2 .card').first();
              cc2.children('.card-holder').append(firstCard);
               $('.card-container-2 .card').css('display','none');
               $('.card-container-2 .card').first().css('display','block');
            });
            cc2.children('.left').on('click',function(){
              var lastCard = $('.card-container-2 .card').last();
              cc2.children('.card-holder').prepend(lastCard);
               $('.card-container-2 .card').css('display','none');
               $('.card-container-2 .card').first().css('display','block');
            });
        </script>
@else

  <div class="col-sm-12 article" >
          <div>
               <h1 class='title'>{{$det->title}}<span class='pull-right'>{{date('Y-m-d',$det->create_time)}}</span></h1>
               <div class='content'>{!!$det->content!!}</div>
               <div class='foo'>{{$det->name}}</div>
          </div>
  </div>

 @endif
@endsection